DEVKIT = /opt/arm-openwiz-linux-gnu/
CROSS_COMPILE = /opt/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-
INC_BASE = /opt/arm-openwiz-linux-gnu/include
LIB_BASE = /opt/arm-openwiz-linux-gnu/lib


CFLAGS =  -Wall -Wall -D__GP2X__ -D__HAYMINIMAL__ -I minimal -I readpng -I cpulcd -I minizip -I$(INC_BASE)  
vpath %.c src:minimal:cpulcd:readpng:minizip
vpath %.h src:minimal:cpulcd:readpng:minizip

CC = $(CROSS_COMPILE)gcc
STRIP = $(CROSS_COMPILE)strip

CFLAGS += -O6
LDFLAGS =  -L"/opt/arm-openwiz-linux-gnu/lib"  -lpng -lz -lc -lm -lrt 


TARGET = bin/selector
OBJS = selector.o minimal.o lang.o cpulcd.o readpng.o unzip.o ioapi.o 

ALL_TARGETS = $(TARGET) 

all :	clean all-before $(ALL_TARGETS)
all-before:
	mkdir -p "bin"
	mkdir -p "obj"


$(TARGET) : $(OBJS)
	$(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) 
	$(STRIP) $(TARGET)
#	rm -f *.o

clean:
	rm -f $(OBJS) $(TARGET)

